<!-- 游戏详情 -->
<template>
  <el-dialog
    :model-value="dialogFormVisible"
    :destroy-on-close="true"
    title="游戏详情信息"
    width="450px"
    @close="emits('closeDialog')"
  >
    <el-form ref="dialogFormRef" :model="dialogForm">
      <el-form-item label="游戏名称" :label-width="formLabelWidth">
        <el-input v-model="dialogForm.name" disabled />
      </el-form-item>
      <el-form-item label="分值" :label-width="formLabelWidth">
        <el-input v-model="dialogForm.score" disabled />
      </el-form-item>
      <div class="flex">
        <el-form-item label="游戏icon" :label-width="formLabelWidth">
          <el-image
            style="width: 70px; height: 70px"
            :src="dialogForm.icon_show"
            alt=""
            fit="fill"
            :preview-src-list="[dialogForm.icon_show]"
            :preview-teleported="true"
          ></el-image>
        </el-form-item>
        <el-form-item label="游戏背景" :label-width="formLabelWidth">
          <el-image
            style="width: 70px; height: 70px"
            :src="dialogForm.img_show"
            alt=""
            fit="fill"
            :preview-src-list="[dialogForm.img_show]"
            :preview-teleported="true"
          ></el-image>
        </el-form-item>
      </div>
      <el-form-item label="游戏封面" :label-width="formLabelWidth">
        <el-image
          style="width: 70px; height: 70px"
          :src="dialogForm.cover_show"
          alt=""
          fit="fill"
          :preview-src-list="[dialogForm.cover_show]"
          :preview-teleported="true"
        ></el-image>
      </el-form-item>
      <el-form-item label="Slogan" :label-width="formLabelWidth">
        <el-input v-model="dialogForm.slogan" disabled />
      </el-form-item>
      <el-form-item label="版本" :label-width="formLabelWidth">
        <el-input v-model="dialogForm.version" disabled />
      </el-form-item>
      <el-form-item label="更新日志" :label-width="formLabelWidth">
        <el-input
          v-model="dialogForm.version_log"
          disabled
          :rows="2"
          type="textarea"
        />
      </el-form-item>
      <el-form-item label="游戏详情" :label-width="formLabelWidth">
        <el-input
          v-model="dialogForm.desc"
          disabled
          :rows="2"
          type="textarea"
        />
      </el-form-item>
      <el-form-item label="H5网址" :label-width="formLabelWidth">
        <el-input v-model="dialogForm.h5_play_url" />
      </el-form-item>
      <el-form-item label="下载链接" :label-width="formLabelWidth">
        <el-input v-model="dialogForm.download_url" />
      </el-form-item>
      <el-form-item label="H5下载地址" :label-width="formLabelWidth">
        <el-input v-model="dialogForm.h5_download_url" />
      </el-form-item>
      <el-form-item label="android下载链接" :label-width="formLabelWidth">
        <el-input v-model="dialogForm.android_download_url" />
      </el-form-item>
      <el-form-item label="ios下载链接" :label-width="formLabelWidth">
        <el-input v-model="dialogForm.ios_download_url" />
      </el-form-item>
      <el-form-item label="安卓包名称" :label-width="formLabelWidth">
        <el-input v-model="dialogForm.android_apk_name" disabled />
      </el-form-item>
      <el-form-item label="苹果ipa名称" :label-width="formLabelWidth">
        <el-input v-model="dialogForm.ios_ipa_name" disabled />
      </el-form-item>
    </el-form>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="emits('cancel')">取消</el-button>
      </span>
    </template>
  </el-dialog>
</template>
<script setup>
import { ref } from "vue";
const dialogFormRef = ref(null);

defineProps({
  dialogFormVisible: {
    type: Boolean,
    default: false,
  },
  dialogForm: {
    type: Object,
    default: {
      id: "",
      name: "",
      score: "",
      cover: "",
      cover_show: "",
      icon: "",
      icon_show: "",
      img: "",
      img_show: "",
      slogan: "",
      version: "",
      version_log: "",
      desc: "",
      h5_play_url: "",
      download_url: "",
      h5_download_url: "",
      android_download_url: "",
      ios_download_url: "",
      android_apk_name: "",
      ios_ipa_name: "",
    },
  },
});
const emits = defineEmits(["closeDialog", "cancel"]);

const formLabelWidth = "120px";
</script>
